/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package view.main;

import java.awt.event.ActionListener;
import javax.crypto.Mac;
import javax.swing.JPanel;

/**
 *
 * @author Stupi
 */
public class MainGUI extends javax.swing.JFrame {

    private static MainGUI instance = null;
    
    public static MainGUI getInstance () {
        if (instance == null)
            instance = new MainGUI();
        return instance;
    }
    
    /**
     * Creates new form MainGUI
     */
    public MainGUI() {
        initComponents();
        setVisible(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlLeft = new javax.swing.JPanel();
        pnlCenter = new javax.swing.JPanel();
        jMenuBar1 = new javax.swing.JMenuBar();
        menuFile = new javax.swing.JMenu();
        mitNew = new javax.swing.JMenuItem();
        mitOpen = new javax.swing.JMenuItem();
        menuEdit = new javax.swing.JMenu();
        menuDataMining = new javax.swing.JMenu();
        mitClassification = new javax.swing.JMenuItem();
        mitClustering = new javax.swing.JMenuItem();
        mitTextMining = new javax.swing.JMenuItem();
        menuStatistics = new javax.swing.JMenu();
        menuVisualization = new javax.swing.JMenu();
        mitVisualize = new javax.swing.JMenuItem();
        mitSaveVisualize = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new java.awt.BorderLayout());

        pnlLeft.setBorder(javax.swing.BorderFactory.createBevelBorder(0));
        pnlLeft.setMaximumSize(new java.awt.Dimension(300, 32767));
        pnlLeft.setMinimumSize(new java.awt.Dimension(200, 100));

        javax.swing.GroupLayout pnlLeftLayout = new javax.swing.GroupLayout(pnlLeft);
        pnlLeft.setLayout(pnlLeftLayout);
        pnlLeftLayout.setHorizontalGroup(
            pnlLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 196, Short.MAX_VALUE)
        );
        pnlLeftLayout.setVerticalGroup(
            pnlLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 420, Short.MAX_VALUE)
        );

        getContentPane().add(pnlLeft, java.awt.BorderLayout.LINE_START);

        pnlCenter.setBorder(javax.swing.BorderFactory.createBevelBorder(0));
        pnlCenter.setMaximumSize(new java.awt.Dimension(700, 32767));

        javax.swing.GroupLayout pnlCenterLayout = new javax.swing.GroupLayout(pnlCenter);
        pnlCenter.setLayout(pnlCenterLayout);
        pnlCenterLayout.setHorizontalGroup(
            pnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 711, Short.MAX_VALUE)
        );
        pnlCenterLayout.setVerticalGroup(
            pnlCenterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 420, Short.MAX_VALUE)
        );

        getContentPane().add(pnlCenter, java.awt.BorderLayout.CENTER);

        menuFile.setText("File");

        mitNew.setText("New");
        menuFile.add(mitNew);

        mitOpen.setText("Open");
        menuFile.add(mitOpen);

        jMenuBar1.add(menuFile);

        menuEdit.setText("Edit");
        jMenuBar1.add(menuEdit);

        menuDataMining.setText("Data Mining");

        mitClassification.setText("Classification");
        mitClassification.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitClassificationActionPerformed(evt);
            }
        });
        menuDataMining.add(mitClassification);

        mitClustering.setText("Clustering");
        menuDataMining.add(mitClustering);

        mitTextMining.setText("Text Mining");
        menuDataMining.add(mitTextMining);

        jMenuBar1.add(menuDataMining);

        menuStatistics.setText("Statistics");
        jMenuBar1.add(menuStatistics);

        menuVisualization.setText("Visualization");

        mitVisualize.setText("Visualize");
        menuVisualization.add(mitVisualize);

        mitSaveVisualize.setText("Save");
        menuVisualization.add(mitSaveVisualize);

        jMenuBar1.add(menuVisualization);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void mitClassificationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitClassificationActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_mitClassificationActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainGUI().setVisible(true);
            }
        });
    }
    
    public void addOpenListener (ActionListener listener) {
        mitOpen.addActionListener(listener);
    }
    
    public void addClassificationListener (ActionListener listener) {
        mitClassification.addActionListener(listener);
    }
    
    public void addClusteringListener (ActionListener listener) {
        mitClustering.addActionListener(listener);
    }
    
    public void addTextMiningListener (ActionListener listener) {
        mitTextMining.addActionListener(listener);
    }
    
    public void addVisualizeListener (ActionListener listener) {
        mitVisualize.addActionListener(listener);
    }
    
    public void addSaveVisualizeListener (ActionListener listener) {
        mitVisualize.addActionListener(listener);
    }
    
    public void addNewListener (ActionListener listener) {
        mitNew.addActionListener(listener);
    }

    public JPanel getPnlLeft() {
        return pnlLeft;
    }

    public JPanel getPnlCenter() {
        return pnlCenter;
    }
         
    
    
    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenu menuDataMining;
    private javax.swing.JMenu menuEdit;
    private javax.swing.JMenu menuFile;
    private javax.swing.JMenu menuStatistics;
    private javax.swing.JMenu menuVisualization;
    private javax.swing.JMenuItem mitClassification;
    private javax.swing.JMenuItem mitClustering;
    private javax.swing.JMenuItem mitNew;
    private javax.swing.JMenuItem mitOpen;
    private javax.swing.JMenuItem mitSaveVisualize;
    private javax.swing.JMenuItem mitTextMining;
    private javax.swing.JMenuItem mitVisualize;
    private javax.swing.JPanel pnlCenter;
    private javax.swing.JPanel pnlLeft;
    // End of variables declaration//GEN-END:variables
}
